import BaseApi from '../BaseApi';

const controller = "/charge";

export default {

    daysStatementsDetail(condition) {
        return this.requestPost(controller, "/daysStatementsDetail", condition);
    },
    WriteOffStatistics(condition) {
        return this.requestPost(controller, "/WriteOffStatistics", condition);
    },
    WriteOffDetail(condition) {
        return this.requestPost(controller, "/WriteOffDetail", condition);
    },
    exportExcel(condition) {
        return this.requestDownloadGet(controller, "/exportDetailExcel", condition);
    },
    exportExcelWriteOff(condition) {
        return this.requestDownloadGet(controller, "/exportExcelWriteOff", condition);
    },
    exportExcelWriteOffDetail(condition) {
        return this.requestDownloadGet(controller, "/exportExcelWriteOffDetail", condition);
    },
    /*请求封装*/
    requestPost(controller, url, condition) {
        let newUrl = controller + url;
        return BaseApi.requestPost(newUrl, condition);

    },
    requestGet(controller, url, condition) {
        let newUrl = controller + url;
        return BaseApi.requestGet(newUrl, condition);
    },
    requestDownloadGet(controller, url, condition) {
        let newUrl = controller + url;
        return BaseApi.requestDownloadGet(newUrl, condition);
    }

}
